<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>domApi</title>
</head>
<body>
<div id="result"></div>
<script>
  if (typeof(Storage) !== 'undefined') {
      try {
          localStorage.setItem('sitename', 'domapi');
          document.getElementById('result').innerHTML = localStorage.getItem('sitename');
      } catch (e) {
          document.getElementById('result').innerHTML = 'sorry';
      }
  }
  function getDomResult() {
      let str = document.getElementById('result').innerHTML;
      return str;
  }
</script>
</body>
</html>